home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995…tember: Reference Library / Dev.CD Sep 95 RL / Dev.CD Sep 95 RL.toast / mac / Technical Documentation / develop / develop Issue 15 code / 3D Interface / 3D Buttons CDEF / Source / 3D Buttons CDEF source / (3D Buttons CDEF.π) / LGBCheckbox.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-29  |  1.9 KB  |  99 lines  |  [TEXT/MMCC]

  1. /**************************************************************************
  2.     LGBCheckbox
  3.     
  4.     Public domain, by Zig Zichterman.
  5.     
  6.     This class implements 3D checkboxes according to the guidelines
  7.     suggested in _develop_ 15. Some of the drawing code is taken from
  8.     the public domain source accompanying _develop_ 15.
  9.     
  10.     1.0b5
  11.         11/28/94    zz    add UseHighlightColor(), UseShadowColor()
  12.         11/27/94    zz    add Calc/UseBackgroundColor(), mBackgroundColor
  13.                         make mControl a ControlHandle (was ControlRecord*)
  14. **************************************************************************/
  15. #pragma once
  16.  
  17. class LGBCheckbox {
  18.     public :
  19.         static long
  20.         Main(
  21.             short            inVariation,
  22.             ControlHandle    ioControl,
  23.             short             inMsg,
  24.             long            ioParam);
  25.  
  26.     // ———— constructor —————————————————————————————————————————————
  27.     protected :
  28.         LGBCheckbox(
  29.             ControlHandle    inControl,
  30.             Boolean            inUseWFont);
  31.             
  32.         ControlHandle    mControl;
  33.         Boolean            mUseWFont;
  34.         GrafPtr            mWindowPort;
  35.         RGBColor        mBackgroundColor;
  36.         RGBColor        mHighlightColor;
  37.         RGBColor        mShadowColor;
  38.         RGBColor        mInactiveFrameColor;
  39.         
  40.     // ———— dispatch —————————————————————————————————————————————————
  41.     protected :
  42.         void
  43.         Draw(
  44.             long    inPartCode);
  45.             
  46.         Boolean
  47.         Test(
  48.             Point    inHitPt);
  49.             
  50.         void
  51.         CalcCRgn(
  52.             RgnHandle    ioRgn);
  53.         
  54.     // ———— Draw —————————————————————————————————————————————————————
  55.     protected :
  56.         void
  57.         DrawBW(void);
  58.         
  59.         void
  60.         DrawColor(void);
  61.         
  62.         void
  63.         DrawColorActive(void);
  64.         
  65.         void
  66.         DrawColorInactive(void);
  67.         
  68.         void
  69.         CalcBoxes(
  70.             Rect    &outCheckbox,
  71.             Rect    &outTitleBox);
  72.             
  73.         void
  74.         DrawCheckbox(
  75.             const Rect    &inCheckbox,
  76.             Boolean        inColor    = false);
  77.             
  78.         void
  79.         DrawTitle(
  80.             const Rect    &inTitlebox,
  81.             Boolean        inDim1Bit    = false);
  82.         
  83.         void
  84.         CalcColors(void);
  85.         
  86.         void
  87.         UseBackgroundColor(void);
  88.         
  89.         void
  90.         UseHighlightColor(void);
  91.         
  92.         void
  93.         UseShadowColor(void);
  94.         
  95.         void
  96.         UseInactiveFrameColor(void);
  97. };
  98.  
  99.